package com.chatdating.entity.dto;

import com.chatdating.entity.pojo.ChatMessages;
import com.chatdating.entity.pojo.SendMessage;
import com.chatdating.entity.vo.LoginInVo;
import com.chatdating.utils.EmptyUtil;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@AllArgsConstructor
@NoArgsConstructor
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class MessageSendDto <T> implements Serializable {
    private static final long serialVersionUID = -1045752033171142417L;
    //消息ID
    private Long messageId;
    //会话ID
    private String sessionId;
    //发送人
    private String sendUserId;
    //发送人昵称
    private String sendUserNickName;
    //联系人ID
    private String contactId;
    //联系人名称
    private String contactName;
    //消息内容
    private String messageContent;

    //最后的消息
    private String lastMessage;

    //发送时间
    private Long sendTime;

    //联系人信息
    private List<LoginInVo> contacts;

    //聊天消息
    private SendMessage sendMessage;

    //离线消息
    private Map<String,Integer> mapNoRead;

    //通知前端已经是 vip 用户
    private SendVip sendVip;

    //扩展信息
    private T extendData;

    //消息状态 0:发送中  1:已发送
    private Integer status;




    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }



    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getSendUserId() {
        return sendUserId;
    }

    public void setSendUserId(String sendUserId) {
        this.sendUserId = sendUserId;
    }

    public String getContactId() {
        return contactId;
    }

    public void setContactId(String contactId) {
        this.contactId = contactId;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }


    public Long getSendTime() {
        return sendTime;
    }

    public void setSendTime(Long sendTime) {
        this.sendTime = sendTime;
    }

    public String getSendUserNickName() {
        return sendUserNickName;
    }

    public void setSendUserNickName(String sendUserNickName) {
        this.sendUserNickName = sendUserNickName;
    }

    public T getExtendData() {
        return extendData;
    }

    public void setExtendData(T extendData) {
        this.extendData = extendData;
    }

    public String getLastMessage() {
        if (EmptyUtil.isEmpty(lastMessage)) {
            return messageContent;
        }
        return lastMessage;
    }

    public void setLastMessage(String lastMessage) {
        this.lastMessage = lastMessage;
    }


    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

}